<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class PayRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'levy_house_num' => 'required',
            'collect_account' => 'required|between:16, 20',
            'collect_bank' => 'required',
            'pay_account' => 'required|between:16, 20',
            'pay_bank' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'levy_house_num.required' =>'请填写房屋编号！',

            'collect_account.required' => '请填写收款账号！',
            'collect_account.between' => '请填写正确的收款账号！',
            'collect_bank.required' => '请填写收款银行名称！',

            'pay_account.required' => '请填写汇款账号！',
            'pay_account.between' => '请填写正确的汇款账号!',
            'pay_bank.required' => '请填写汇款银行名称！',
        ];
    }
}
